<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="18-history2.html">点击就走</a>
    <button>后退</button>
    <script>
        var btn = document.querySelector('button')
        btn.addEventListener('click',function() {
            // history.forward()//前进功能 跳转到18-history2
            history.go(1)//同上 不过参数为数字 1就是前进一个页面 -1就是后退一个页面
        })
    </script>
</body>
</html>